package edu.nf.ch01;

import edu.nf.ch01.converter.UserConverter;
import edu.nf.ch01.entity.Card;
import edu.nf.ch01.entity.Teacher;
import edu.nf.ch01.entity.User;
import edu.nf.ch01.vo.UserVO;

/**
 * @author wangl
 * @date 2025/10/23
 */
public class Main {

    public static void main(String[] args) {
        testMapping();
    }

    private static void testMapping() {
        Card card = new Card();
        card.setCardNum("44090987890998889");
        User user = new User();
        user.setCard(card);
        user.setUsername("user1");
        user.setAge(18);
        Teacher teacher = new Teacher();
        teacher.setName("wangl");
        //将user对象拷贝到UserVO中
        UserVO vo = UserConverter.INSTANCE.toUserVO(user, teacher);
        System.out.println(vo.getUserName());
        System.out.println(vo.getUserAge());
        System.out.println(vo.getCardNum());
        System.out.println(vo.getTeacherName());
    }
}